package com.qianyi.person.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qianyi.person.domain.User;
import com.qianyi.person.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
   private UserMapper userMapper;
   public User selectByPrimaryKey(Integer id){

       return userMapper.selectByPrimaryKey(id);
   }

   public PageInfo<User> selectAllUser(int pageNum, int pageSize){
       Page<User> page= PageHelper.startPage(pageNum,pageSize);
       userMapper.selectAllUser();
       return page.toPageInfo();
    }

    public  User selectBynameAndpwd(User user){
       return  userMapper.selectBynameAndpwd(user);
    }
}
